window.showRewardedVideoAd = function() {
    if (fish.videoAd) fish.videoAd.show().then(function() {
        fish.audio.setEffectsVolume(0), fish.audio.setMusicVolume(0);
    }); else {
        fish.videoAd = wx.createRewardedVideoAd({
            adUnitId: "adunit-31b464151567ef7e"
        });
        var e = cc.sys.localStorage.getItem("effectVolume"), s = cc.sys.localStorage.getItem("musicVolume"), i = 0, t = 0;
        e ? i = parseInt(e) : (i = 1, cc.sys.localStorage.setItem("effectVolume", "1")), 
        s ? t = parseInt(s) : (t = 1, cc.sys.localStorage.setItem("musicVolume", "1")), 
        fish.videoAd.onClose(function(e) {
            fish.audio.setEffectsVolume(i), fish.audio.setMusicVolume(t), !e || e && e.isEnded ? fish.evtCenter.trigger(fish.evts.EVT_WATCH_AD_SUCCESS) : fish.evtCenter.trigger(fish.evts.EVT_WATCH_AD_UNFINISHED);
        }), fish.videoAd.onError(function() {
            fish.audio.setEffectsVolume(i), fish.audio.setMusicVolume(t), fish.evtCenter.trigger(fish.evts.EVT_WATCH_AD_FAIL);
        }), fish.videoAd.load().then(function() {
            fish.videoAd.show().then(function() {
                fish.audio.setEffectsVolume(0), fish.audio.setMusicVolume(0);
            });
        }).catch(function(e) {
            console.log(e.errMsg), fish.videoAd = null, fish.evtCenter.trigger(fish.evts.EVT_WATCH_AD_FAIL);
        });
    }
};